package com.bnz.manager.group;

import com.bnz.manager.entity.SpecificationEntity;
import com.bnz.manager.entity.SpecificationOptionEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * 用于组合规格以及规格选项列表的类
 */

@Data // 创建get，set，toString方法
@AllArgsConstructor // 全参构造
@NoArgsConstructor  // 无参构造
public class Specification implements Serializable {

    // SpecificationEntity实体类有 id spec_name
    private SpecificationEntity spec;

    // 将SpecificationOptionEntity实体类放进list集合，有：id,option_name,spec_id,orders
    private List<SpecificationOptionEntity> options;
    /**
     * 前端反映：
     * {"spec":{"id":11,"specName":"aa"},"options":[{"id":1,"optionName":"aa-01","specId":11}]}
     *
     * {"spec":{"specName":"aa"},"options":[{"optionName":"aa","orders":"aa-1"},{"optionName":"bb","orders":"bb-1"}]}
     *
     * {"specName": "aa", "options": [ { "optionName": "a", "orders": "b" }, { "optionName": "d", "orders": "c" } ]}
     */

}
